package com.yanqu.road.entity.activity.fivehero.config;

import com.yanqu.road.entity.FieldTypeAnnotation;
import com.yanqu.road.utils.string.StringUtils;

import java.util.ArrayList;
import java.util.List;

@FieldTypeAnnotation(tableName = "t_s_activity_five_hero_city")
public class FiveHeroCityConfig {

    @FieldTypeAnnotation(desc = "活动ID", select = true)
    private int activityId;
    @FieldTypeAnnotation(desc = "城池ID")
    private int id;
    @FieldTypeAnnotation(desc = "城池类型名称")
    private String name;
    @FieldTypeAnnotation(desc = "城池类型")
    private int type;
    @FieldTypeAnnotation(desc = "初始阵营")
    private int initialCamp;
    @FieldTypeAnnotation(desc = "城池显示类型")
    private int showType;
    @FieldTypeAnnotation(desc = "职业门客战力加成(职业id；千分比) 0无加成")
    private String jobBuffEffect;

    private List<Integer> jobBuffEffectList = new ArrayList<>();

    public int getActivityId() {
        return activityId;
    }

    public void setActivityId(int activityId) {
        this.activityId = activityId;
    }

    public int getId() {
        return id;
    }

    public void setId(int id) {
        this.id = id;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getType() {
        return type;
    }

    public void setType(int type) {
        this.type = type;
    }

    public int getInitialCamp() {
        return initialCamp;
    }

    public void setInitialCamp(int initialCamp) {
        this.initialCamp = initialCamp;
    }

    public int getShowType() {
        return showType;
    }

    public void setShowType(int showType) {
        this.showType = showType;
    }

    public String getJobBuffEffect() {
        return jobBuffEffect;
    }

    public void setJobBuffEffect(String jobBuffEffect) {
        this.jobBuffEffect = jobBuffEffect;
        List<String> tempList = StringUtils.stringToStringList(jobBuffEffect,"\\|");
        for(int i = 0;i < tempList.size(); i++){
            String aaStr = tempList.get(i);
            if(!"0".equals(aaStr)){
                jobBuffEffectList.addAll(StringUtils.stringToIntegerList(aaStr,";"));
            }else{
                //两个两个一组，被优化得很奇怪
                jobBuffEffectList.add(0);
                jobBuffEffectList.add(0);
            }
        }
    }

    public List<Integer> getJobBuffEffectList() {
        return jobBuffEffectList;
    }
}
